# -*- encoding: utf-8 -*-
"""

PyCharm 04绘制矩形
2024年10月20日16时25分
by wenyang

"""
import cv2 as cv


def main():
    img = cv.imread("./img.png")
    # 绘制矩形
    # 首先要有一个坐标点
    x, y, w, h = 100, 100, 200, 200
    # 然后就是绘制矩形
    cv.rectangle(img, (x, y, w, h), color=(124, 124, 0), thickness = 1)
    # 绘制圆形
    cv.circle(img, center = (x + w, y + h), radius = 100, color = (255, 0, 0), thickness = 2)
    # 显示
    cv.imshow("image", img)
    # 等待键盘键入退出
    while True:
        if ord("q") == cv.waitKey(0):
            break
    # 释放内存资源
    cv.destroyAllWindows()



if __name__ == "__main__":
    main()
